Skip to content

Fix nginx IPv6 resolution causing backend connection failures#385

Merged
ShaneIsrael merged 2 commits intodevelopfrom
copilot/update-nginx-to-use-ipv4
Jan 17, 2026
Merged

Fix nginx IPv6 resolution causing backend connection failures#385
ShaneIsrael merged 2 commits intodevelopfrom
copilot/update-nginx-to-use-ipv4

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

Nginx resolves localhost to IPv6 [::1] on some systems, but the backend only listens on IPv4, causing "upstream server temporarily disabled while connecting to upstream" errors.

Changes

  • Updated proxy_pass directives in /api/* and /w/* locations to use explicit IPv4 address 127.0.0.1:5000 instead of localhost:5000
  • Applied to both production (app/nginx/prod.conf) and development (app/nginx/dev.template.conf) configurations
 location ~ /api/.*$ {
-    proxy_pass              http://localhost:5000;
+    proxy_pass              http://127.0.0.1:5000;
     proxy_http_version      1.1;
Original prompt

Problem

Nginx is attempting to connect to the backend using IPv6 localhost [::1]:5000, but the backend may only be listening on IPv4, causing connection failures with the error:

upstream server temporarily disabled while connecting to upstream

Solution

Update nginx configuration files to explicitly use IPv4 localhost (127.0.0.1) instead of localhost to avoid IPv6/IPv4 resolution issues.

Files to Update

  1. app/nginx/prod.conf - Update lines 53 and 61:

    • Change proxy_pass http://localhost:5000; to proxy_pass http://127.0.0.1:5000;
  2. app/nginx/dev.template.conf - Update lines 48 and 56:

    • Change proxy_pass http://localhost:5000; to proxy_pass http://127.0.0.1:5000;

Expected Outcome

  • Nginx will reliably connect to the backend on IPv4 localhost
  • Eliminates "upstream server temporarily disabled" errors
  • API requests to /api/* and /w/* endpoints will work consistently

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update Nginx configuration to use IPv4 localhost Fix nginx IPv6 resolution causing backend connection failures Jan 17, 2026
Copilot AI requested a review from ShaneIsrael January 17, 2026 22:15
@ShaneIsrael ShaneIsrael marked this pull request as ready for review January 17, 2026 22:20
@ShaneIsrael
Copy link
Owner

Hoping this fixes an upstream connect error that happens all the time.

@ShaneIsrael ShaneIsrael merged commit 9dcc2ad into develop Jan 17, 2026
@ShaneIsrael ShaneIsrael deleted the copilot/update-nginx-to-use-ipv4 branch January 31, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants